#Written by MMCOWBOY
import pygame
import random

class star_obj(pygame.sprite.Sprite):
    def __init__(self, screen_size):
        super(star_obj, self).__init__(self.containers)
        self.screen_width = screen_size[0]
        self.screen_height = screen_size[1]
        self.image = pygame.image.load("data/images/star.png")
        self.rect = self.image.get_rect().move(random.randint(0,self.screen_width),random.randint(0,self.screen_height))
        self.speed = (random.randint(1,3))

    def draw(self, screen):
        screen.blit(self.image, self.rect)

    def update(self):
        if (self.rect.top + self.speed >= self.screen_height):
            self.rect = self.image.get_rect().move(random.randint(0,self.screen_width),-random.randint(10,150))
        else:
            self.rect = self.rect.move(0,self.speed)
